package vcp.gui.forms.validators;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class NumericValidator {
	private Pattern pattern;
	private Matcher matcher;
	private static final String PATTERN = "[+-]?\\d{1,3}(,\\d{3})*\\.?\\d+";

	public  NumericValidator(){
		pattern = Pattern.compile(PATTERN);
	}	
	public boolean validate(String txt){		 
		  matcher = pattern.matcher(txt);
		  return matcher.matches();
	}	
}
